<template>
    <div class="index">
        <el-container>
            <!-- 左侧导航栏 -->
            <el-aside width="3.2rem" style="background: #20222A">
                <Nav></Nav>
            </el-aside>

            <!-- 右面内容 -->
            <el-container>
                <el-header>
                    <top-nav></top-nav>
                </el-header>
                <el-container  v-loading="loading" style="background-color:whitesmoke; overflow: hidden;">
                    <el-main  >
                       
                            <router-view></router-view>
                  
                    </el-main>
                </el-container>
            </el-container>

        </el-container>
    </div>
</template>

<script>
import Nav from '@/components/nav/Nav'
import TopNav from '@/components/topNav/TopNav'
import axios from 'axios'

export default {
    name: 'Index',
    components: {
        Nav,
        TopNav
    },
    created () {
        // axios.defaults.baseURL = 'http://localhost/fastAskManage/public/index.php/';
        axios.get('/index/App/getQiniuDomain')
            .then((datas) => {
                 var data = datas.data;
                 var localStorage = window.localStorage;
                 if (data.status === 0) {
                     var qiniuDomain = data.data.qiniuDomain;
                     localStorage.setItem('dcw_qiniuDomain', qiniuDomain);
                     this.$store.commit('setQiniuDomain', `http://${qiniuDomain}/`);
                 }
                 else {
                     this.$message.error('未请求到七牛云Domain');
                 }
            }, (err) => {

            });
    },
    mounted () {
        
    },
    data () {
        return {
           
        }
    },
    computed: {
        loading() {
            return this.$store.state.loading
        }
    }
}
</script>


<style lang="stylus" scoped>
    .index
        width 100%
        height 100%
        position absolute
        left 0
        top 0
        display flex
        .el-header
            background white
            height 1.2rem !important
        .el-main
            margin .35rem
            background white
        

            
</style>


